package com.itheima.mapper;

import com.itheima.dto.LinechartDto;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @author YuanDao
 * @date 2021/3/26 18:44
 */
public interface LinechartMapper {
    //查询数据
    @Select("select count(tm.create_date_id) count,rd.fdate\n" +
            "            from  rpt_date rd  left join  tb_member tm on tm.create_date_id = rd.id\n" +
            "         where fdate >= #{StartStr} and fdate<=#{endStr}\n" +
            "            group by fmonth order by fdate desc")
    List<LinechartDto> lineChat(@Param("StartStr") String startDate,@Param("endStr") String closeDate);

    @Select("select (case when sex = '1' then '男' else '女' end) name,count(sex) value \n" +
            "from tb_member group by sex;")
    List<Map> selectReportSex();
}
